Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS opacity based on prefers-reduced-transparency media query #30999

Merged
merged 4 commits into from
Dec 21, 2023

Conversation

ramiy
Copy link
Contributor

@ramiy ramiy commented Dec 14, 2023

Description

Add an example that demonstrates how to use the prefers-reduced-transparency media query to specify the desired opacity based on the user's preferences.

@ramiy ramiy requested a review from a team as a code owner December 14, 2023 11:18
@ramiy ramiy requested review from estelle and removed request for a team December 14, 2023 11:18
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Dec 14, 2023
Copy link
Contributor

github-actions bot commented Dec 14, 2023

Preview URLs

(comment last updated: 2023-12-15 14:43:41)

@ramiy
Copy link
Contributor Author

ramiy commented Dec 14, 2023

@chrisdavidmills, this PR is similar to #30712.

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested 1) edits to see also and 2) moving the mention from the description section to the a11y section.

I am not sure if you want to expand on this PR or if we should open an issue, but this page could use some work completely unrelated to the PRT issue.

Stuff i would love to see

  • Even though the element is not visible, it is still part of the DOM. If it was in the tabindex order when visible it will still be there. We do mention pointer events. But we should tell people to make the content visible when focused.
  • Opacity alone should not be used to provide information to screen readers. Use the hidden attribute or visibility or display style properties. It's best to avoid using aria-hidden attribute, but if hidden with opacity, hide it from screen readers too.
  • a mention of setting opacity as a value for @starting-style when transitioning from display none to a visible value.
  • a comment in the stacking context paragraph about how adding opacity can improve perf, with a link to where that's described.
  • maybe a link to a drag/drop example as opacity is commonly used on items being dragged.

files/en-us/web/css/opacity/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/opacity/index.md Outdated Show resolved Hide resolved
@ramiy
Copy link
Contributor Author

ramiy commented Dec 15, 2023

@estelle I prefer no to expand this PR.

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@estelle estelle merged commit e96d15e into mdn:main Dec 21, 2023
7 checks passed
Tenkir pushed a commit to Tenkir/content that referenced this pull request Dec 22, 2023
…n#30999)

* CSS `opacity` based on `prefers-reduced-transparency` media query

* Apply suggestions from code review

Co-authored-by: Estelle Weyl <[email protected]>

* update

---------

Co-authored-by: Estelle Weyl <[email protected]>

S
Tenkir pushed a commit to Tenkir/content that referenced this pull request Dec 22, 2023
…n#30999)

* CSS `opacity` based on `prefers-reduced-transparency` media query

* Apply suggestions from code review

Co-authored-by: Estelle Weyl <[email protected]>

* update

---------

Co-authored-by: Estelle Weyl <[email protected]>

S
@ramiy ramiy deleted the patch-1 branch December 22, 2023 22:17
dipikabh pushed a commit to dipikabh/content that referenced this pull request Jan 17, 2024
…n#30999)

* CSS `opacity` based on `prefers-reduced-transparency` media query

* Apply suggestions from code review

Co-authored-by: Estelle Weyl <[email protected]>

* update

---------

Co-authored-by: Estelle Weyl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants